				
                <div id="page-content">
			        <div class="col-sm-12 eq-box-sm">
			        	<div class="panel ">
						    <div class="panel-body">
						    	<a id="add" class="btn btn-primary data-toolbar" href="#(ctx)/admin/sys/cms/getEditPage?type=#(type)"></i> 起草</a>
						    	<a id="del" class="btn btn-danger data-toolbar" onclick="delSel()" href="javascript:void(0);"><i class="demo-pli-cross"></i> 批量删除</a>
						        <table id="pageTable" class="demo-add-niftycheck" data-toolbar="#del,#add"
						               data-search="true"
						               data-show-refresh="true"
						               data-show-toggle="true"
						               data-show-columns="true"
						               data-sort-name="id"
						               data-page-list="[5, 10, 20]"
						               data-page-size="5"
						               data-pagination="true" data-show-pagination-switch="true" ></table>
						    </div>
						</div>
			        </div>
                </div>
<script>
	
	var col = [{
	       field: 'checked',
	       checkbox : true,
	       align: 'center'
	   }, {
	       field: 'id',
	       title: 'id',
	       align: 'center'
	   }, {
	       field: 'title',
	       title: '标题',
	       align: 'center'
	   }, {
	       field: 'writer_name',
	       title: '创建用户',
	       align: 'center'
	   }, {
	       field: 'writer_orgname',
	       title: '发布单位',
	       align: 'center'
	   }, {
	       field: 'publish_time',
	       title: '发布时间',
	       align: 'center'
	   }, {
	       field: 'if_publish',
	       title: '是否发布',
	       align: 'center',
	       formatter:function(value,row,index){
	    	   if(value=='0'){//未提交
	    		   return "未发布";
	    	   }else{
	    		   return "已发布";
	    	   }
	       }
	   }, {
	       field: 'if_publish',
	       title: '操作',
	       align:'left',
	       width:'250',
	       formatter:function(value,row,index){
	    	   var a  =     '<a class="label label-table label-success" href="'+ctx+'/admin/sys/cms/getEditPage?type=#(type)&id='+row.id+'&view=detail" >查看</a>&nbsp;';
	    	   if(value=='0'){//未发布
		           	a = a + '<a class="label label-table label-success" href="'+ctx+'/admin/sys/cms/getEditPage?type=#(type)&id='+row.id+'" >修改</a>&nbsp;';
		           	a = a + '<a class="label label-table label-info" onclick="publish(\''+row.id+'\')" href="javascript:void(0);" >发布</a>&nbsp;';
		           	a = a + '<a class="label label-table label-danger" onclick="del(\''+row.id+'\')" href="javascript:void(0);" >删除</a>&nbsp;';
	    	   }else{
	    		    if("#(type)"=="4"){//帮扶认领
	    		    	a = a + '<a class="label label-table label-info" href="'+ctx+'/admin/sys/cms/getReceiveListPage?id='+row.id+'" >认领情况</a>&nbsp;';
	    		    }
	    		    a = a + '<a class="label label-table label-danger" onclick="callBack(\''+row.id+'\')" href="javascript:void(0);" >取回</a>&nbsp;';
	    	   }
		       return a;
	       }
	   }];
	var opt = {
		    //请求方法
			   method: 'get',
			    //是否显示行间隔色
			   striped: true,
			   //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）     
			   cache: false,  
			   //data-toolbar: "#demo-delete-row",
			   //是否显示分页（*）  
			   pagination: true,   
			    //是否启用排序  
			   sortable: false,    
			    //排序方式 
			   sortOrder: "asc",    
			   //初始化加载第一页，默认第一页
			   //我设置了这一项，但是貌似没起作用，而且我这默认是0,- -
			   //pageNumber:1,   
			   //每页的记录行数（*）   
			   pageSize: 10,  
			   //可供选择的每页的行数（*）    
			   pageList: [10, 25, 50, 100],
			   //这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据  
			   url: ctx+"/admin/sys/cms/getListData",
			   //默认值为 'limit',传给服务端的参数为：limit, offset, search, sort, order Else
			   //queryParamsType:'',   
			   ////查询参数,每次调用是会带上这个参数，可自定义                         
			   queryParams : function(params) {
			       return {
			             pageNumber: (params.offset/params.limit)+1,
			             pageSize: params.limit,
			             type:"#(type)"
			           };
			   },
			   //分页方式：client客户端分页，server服务端分页（*）
			   sidePagination: "server",
			   //是否显示搜索
			   search: false,  
			   //Enable the strict search.    
			   strictSearch: true,
			   //Indicate which field is an identity field.
			   idField : "id",
			   columns: col,
			   pagination:true,paginationShowPageGo: true
			}; 
		
	//表格
	function initTable(){
		$('#pageTable').bootstrapTable(opt);
		$('#pageTable').bootstrapTable('hideColumn', 'id');

	}
	function refreshTable(){
		$("#pageTable").bootstrapTable('refresh', opt);
		$('#pageTable').bootstrapTable('hideColumn', 'id');
	}
	//批量删除
	function delSel(){
		var data = [];
		$("#pageTable input[type='checkbox'][name!='btSelectAll']:checked").each(function(){
			data.push($(this).val());
		});
		if(data.length==0){
			pointLion.alertMsg("请选择要删除的数据!","danger",null,null);
			return;
		}
		del(data.join(","));//执行删除
	}
	//删除
	function del(ids){
		pointLion.confimMsg("您是否要删除所选公告 ?<br/> 点击确认进行删除 , 点击取消取消该操作",null,function(){
			//执行删除
			var data = common_ajax.ajaxFunc("/admin/sys/cms/delete",{"ids":ids}, "json", null);
			//删除结果
			if(data.success){
				pointLion.alertMsg(data.message,"success",null,function(){
					location.href = ctx+'/admin/sys/cms/getListPage?type=#(type)';//跳转到列表页
				});
			}else{
				pointLion.alertMsg(data.message,"success",null,null);
			}
		});
	};
	//发布
	function publish(id){
			pointLion.confimMsg("您将要发布该内容！<br/><span style='color:green;'>用户将会收到该内容！<br/>您将无法进行修改和删除！！！</span> <br/>点击确认进行提交 , 点击取消取消该操作",null,function(){
				var data = common_ajax.ajaxFunc("/admin/sys/cms/publish",{"id":id}, "json", null);
				if(data.success){
					pointLion.alertMsg(data.message,"success",null,function(){
						location.href = ctx+'/admin/sys/cms/getListPage?type=#(type)';//跳转到列表页
					});
				}
			});
	}
	//取回
	function callBack(id){
		pointLion.confimMsg("您将要取回该内容！取回将可以对内容进行修改和删除！<br/><span style='color:red;'>取回之后用户将无法看到该内容！<br/>取回之后如果进行修改，重新发布之后，被通知人将可重新收到该内容！</span> <br/>点击确认进行取回 , 点击取消取消该操作",null,function(){
			//执行删除
			var data = common_ajax.ajaxFunc("/admin/sys/cms/callBack",{"id":id}, "json", null);
			//删除结果
			if(data.success){
				pointLion.alertMsg(data.message,"success",null,function(){
					location.href = ctx+'/admin/sys/cms/getListPage?type=#(type)';//跳转到列表页
				});
			}else{
				pointLion.alertMsg(data.message,"danger",null,null);
			}
		});
	}
	$(document).ready(function(){
		
		initTable();//初始化表格
	});
</script>
